package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.MainventilatorTwoMapper;
import com.ruoyi.control.domain.MainventilatorTwo;
import com.ruoyi.control.service.IMainventilatorTwoService;

/**
 * 主通风机2号风机Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class MainventilatorTwoServiceImpl extends ServiceImpl<MainventilatorTwoMapper, MainventilatorTwo> implements IMainventilatorTwoService //修改
{
    @Autowired
    private MainventilatorTwoMapper mainventilatorTwoMapper;

    /**
     * 查询主通风机2号风机
     * 
     * @param address 主通风机2号风机主键
     * @return 主通风机2号风机
     */
    @Override
    public MainventilatorTwo selectMainventilatorTwoByAddress(String address)
    {
        return mainventilatorTwoMapper.selectMainventilatorTwoByAddress(address);
    }

    /**
     * 查询主通风机2号风机列表
     * 
     * @param mainventilatorTwo 主通风机2号风机
     * @return 主通风机2号风机
     */
    @Override
    public List<MainventilatorTwo> selectMainventilatorTwoList(MainventilatorTwo mainventilatorTwo)
    {
        return mainventilatorTwoMapper.selectMainventilatorTwoList(mainventilatorTwo);
    }

    /**
     * 新增主通风机2号风机
     * 
     * @param mainventilatorTwo 主通风机2号风机
     * @return 结果
     */
    @Override
    public int insertMainventilatorTwo(MainventilatorTwo mainventilatorTwo)
    {
        return mainventilatorTwoMapper.insertMainventilatorTwo(mainventilatorTwo);
    }

    /**
     * 修改主通风机2号风机
     * 
     * @param mainventilatorTwo 主通风机2号风机
     * @return 结果
     */
    @Override
    public int updateMainventilatorTwo(MainventilatorTwo mainventilatorTwo)
    {
        mainventilatorTwo.setUpdateTime(DateUtils.getNowDate());
        return mainventilatorTwoMapper.updateMainventilatorTwo(mainventilatorTwo);
    }

    /**
     * 批量删除主通风机2号风机
     * 
     * @param addresss 需要删除的主通风机2号风机主键
     * @return 结果
     */
    @Override
    public int deleteMainventilatorTwoByAddresss(String[] addresss)
    {
        return mainventilatorTwoMapper.deleteMainventilatorTwoByAddresss(addresss);
    }

    /**
     * 删除主通风机2号风机信息
     * 
     * @param address 主通风机2号风机主键
     * @return 结果
     */
    @Override
    public int deleteMainventilatorTwoByAddress(String address)
    {
        return mainventilatorTwoMapper.deleteMainventilatorTwoByAddress(address);
    }

    @Override
    public List<MainventilatorTwo> getList() {
        List<String> mainventilatorTwo = Arrays.asList("YJDJQZWD","YJDJHZWD","YJDJaXWD",
                "YJDJbXWD","YJDJcXWD","BPQSRDY_3","BPQSCDY_3","BPQSRDL_3","BPQSCDL_3",
                "BPQSRGL_3","BPQSCGL_3","BPQYXPL_3","EJDJQZWD","EJDJHZWD","EJDJaXWD","EJDJbXWD","EJDJcXWD",
                "BPQSRDY_4","BPQSCDY_4","BPQSRDL_4","BPQSCDL_4", "BPQSRGL_4","BPQSCGL_4",
                "BPQYXPL_4","HXZF","ZXZF","FS","FY","DFKDW_2","DFGDW_2");
        List<MainventilatorTwo> twoList = new ArrayList<>();
        for (String s : mainventilatorTwo) {
            MainventilatorTwo mainventilatorTwo1 = mainventilatorTwoMapper.selectMainventilatorTwoByName(s);
            twoList.add(mainventilatorTwo1);
        }
        return twoList;
    }

    @Override
    public List<MainventilatorTwo> getDF() {
        List<String> mainventilatorTwo = Arrays.asList("DFKDW_2","DFGDW_2");
        List<MainventilatorTwo> twoList = new ArrayList<>();
        for (String s : mainventilatorTwo) {
            MainventilatorTwo mainventilatorTwo1 = mainventilatorTwoMapper.selectMainventilatorTwoByName(s);
            twoList.add(mainventilatorTwo1);
        }
        return twoList;
    }
}
